Conversation
# Conflicts: # src/main/java/homework_1/Main.java
f766609 to
bfb5444
Compare
3919f28 to
ba3855b
Compare
94f3e80 to
05f80cc
Compare
| testImplementation 'org.hamcrest:hamcrest:2.2' | ||
| testImplementation 'org.hamcrest:hamcrest-library:2.2' |
There was a problem hiding this comment.
Hamcrest matchers are nice!
| public class Main { | ||
|
|
||
| public static void main(String[] args) { | ||
| new Game().run(); |
There was a problem hiding this comment.
Input is not quite simple... Automatic ship placement is nice!
There was a problem hiding this comment.
Opt: Your utils folder is oversized, some classes should be moved to other places
There was a problem hiding this comment.
Quite good! You show good knowledge of Java Core and Java libraries, code is mostly clean and easy to read. Abstractions are chosen correctly, also good architecture. I didn't see any bugs in the game, but it would look better if you refactor the interface.
Approved!
| int counter = 0; | ||
| for (int i = 0; i < player.getMonitorField().getField().length; i++) { | ||
| for (int j = 0; j < player.getMonitorField().getField().length; j++) { | ||
| if (player.getMonitorField().getField()[i][j].getState() == Position.State.HIT) { | ||
| counter++; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Opt: that's not really efficient... you iterate through all field each turn. There are much easier ways to achieve the same result
|
|
||
| import java.util.*; | ||
|
|
||
| public final class Book { |
There was a problem hiding this comment.
Also, there's no description of a immutable class
|
|
||
| @Target(ElementType.TYPE) | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| public @interface FilePath { |
| KittenToCatFunction<Kitten, Cat> function = (k -> new Cat(k.getName(), | ||
| k.getAge() + 1, k.getWeight() * 3)); |
There was a problem hiding this comment.
Opt: introduce such fields and such lambda, that you'll be able to perform type conversion (as example, favourite color to favorite toy, different classes)
|
|
||
| @ParameterizedTest | ||
| @MethodSource("invalidCoordinates") | ||
| void givenInvalidCoordinate_whenRun_thenCheckReturn(Coordinate coordinate) { |
NikolaevArtem
left a comment
There was a problem hiding this comment.
Well-done! There are some fixes TBD in HW_3, but I'll approve your homework now with the promise that you'll fix it.
Good job, homework is approved!
src/main/java/homework_3/Book.java
Outdated
| public Book(String name, int age, String... authors) { | ||
| this.title = name; | ||
| this.year = age; | ||
| this.authors = authors; |

No description provided.